import request from '@/utils/request'

// 获取频道
export const getMyChannels = () => request.get('v1_0/user/channels')

// 获取文章新闻推荐
export const getArticles = params => request.get('/v1_0/articles', { params })

// 获取所有频道列表
export const getAllChannels = () => request.get('/v1_0/channels')

// 获取文章详情
export const getArticleItem = (id) => request.get(`/v1_0/articles/${id}`)

// 对文章点赞
export const ArticleItemDianZan = data => request.post('/v1_0/article/likings', data)

// 取消文章点赞
export const ArticleItemDianZanNo = target => request.delete(`/v1_0/article/likings/${target}`)

// 收藏文章
export const ArticleItemShouCang = data => request.post('/v1_0/article/collections', data)

// 取消收藏文章
export const ArticleItemShouCangNo = target => request.delete(`/v1_0/article/collections/${target}`)

// 对文章或者评论进行评论
export const Comments = data => request.post('/v1_0/comments', data)

// 获取评论或者回复
export const getComments = (params) => request.get('/v1_0/comments', { params })
